<template>
  <div class="other-login">
    <el-popover
      :width="200"
      popper-style="box-shadow: rgb(14 18 22 / 35%) 0px 10px 38px -10px, rgb(14 18 22 / 20%) 0px 10px 20px -15px; padding: 20px;"
    >
      <template #reference> 其他登录 </template>
      <template #default>
        <div class="social-signup-container flx-justify-around">
          <div class="sign-btn" @click="wechatHandleClick('wechat')">
            <div class="wx-svg-container flx-center">
              <SvgIcon name="wechat-w" :iconStyle="{ width: '30px', height: '30px' }" />
            </div>
            <div>WeChat</div>
          </div>
          <div class="sign-btn" @click="tencentHandleClick('tencent')">
            <div class="qq-svg-container flx-center">
              <SvgIcon name="qq-w" :iconStyle="{ width: '30px', height: '30px' }" />
            </div>
            <div>QQ</div>
          </div>
        </div>
      </template>
    </el-popover>
  </div>
</template>

<script setup lang="ts" name="login">
import SvgIcon from "@/components/SvgIcon/index.vue";
const emit = defineEmits(["wechatHandleClick", "tencentHandleClick"]);
// 微信登录
const wechatHandleClick = thirdpart => {
  emit("wechatHandleClick", thirdpart);
};
// QQ登录
const tencentHandleClick = thirdpart => {
  emit("tencentHandleClick", thirdpart);
};
</script>

<style scoped lang="scss">
.other-login {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  font-size: 14px;
  color: $primary-color;
  cursor: pointer;
}
.social-signup-container {
  .sign-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .icon {
    color: #fff;
    font-size: 24px;
    margin-top: 8px;
  }
  .wx-svg-container,
  .qq-svg-container {
    width: 40px;
    height: 40px;
    padding-top: 1px;
    border-radius: 4px;
    margin-bottom: 10px;
    margin-right: 5px;
  }
  .wx-svg-container {
    background-color: #24da70;
  }
  .qq-svg-container {
    background-color: #6ba2d6;
  }
}
</style>
